import get from '@dfeidao/atom-web/global/get';
import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import fire from '@dfeidao/atom-web/msg/fire';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import success from '@dfeidao/atom-web/msgbox/success';
import hide from '@dfeidao/atom-web/ui/hide';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';

export default async function a002(fd: IFeidaoAiBrowserComponent) {
	// todo
	const nos = get('nos');
	const flag = get('flag');
	const res=await nodejs<{code: 0|1;result: string}>('examination-management/zj-000005/s001', {filter:{exam_id:nos}});
						 if (res.code === 1) {
							success('删除成功！');
						 const addtol=fd.data.node.querySelector<HTMLDivElement>('[data-id="show"]');
						 // 修改display-n 为false 隐藏
						 set_node_cls(addtol, 'display-n',true);
						 hide(fd.data.node);
						 if (flag === 1 ) {
							fire('zj-000001','a010');
						} else {
						fire('zj-000001','a002');
						}
					 }if (res.code === 0 ) {
						 alert("删除失败");
							}
}
